1. Field of the Invention
The invention relates generally to computer systems and more particularly to systems and methods for enabling computer systems that implement data representations having a particular “endian-ness” to operate in conjunction with data sources that may have either the same endian-ness or different endian-ness.
2. Related Art
Modern computer systems provide ever-increasing capacity to process data. This capacity is expanded by making processors faster, smaller and more efficient. Often, computer systems will implement several processor cores to process data in parallel. The increased computing capability of these computers, however, is meaningless if the computers cannot properly communicate the data that is processed.
One of the issues that can cause problems in the communication of data is the manner in which data is represented. Computer systems typically represent data as a series of binary digits (1's and 0's). A byte (8 bits) of data can represent a decimal value from 0 to 255. For instance, the bit string “00000001” represents the decimal value “1”.
In order for a computer system to properly interpret this bit string, however, it is necessary to know which bit is the first bit in the string, or if a data word contains multiple bytes, which byte is the first byte. Some computer systems store data beginning with the least significant byte (a “little-endian” data representation), while others store data beginning with the most significant byte (a “big-endian” data representation). If the same computer reads and writes the data, it will be properly interpreted, because only a single data representation is used. If different computer systems (or other devices) that use different data representations are used to write and read the data, however, care must be taken to ensure that the data is properly interpreted by both systems. If a data word is interpreted beginning with the wrong end of the word, the value of the data word will be misinterpreted.
Another issue that may cause problems in the communication of data between systems that use different data representations relates to the use of SIMD (single instruction, multiple data) instructions. SIMD-type instructions include multiple words that are interpreted as both control information and data. For instance, one system might use 128-bit lines of data (four 32-bit words) that can be interpreted as control information and three data words. In one instance, the line of data could be interpreted as a one-word shift value or address, with three words of data. In another alternative, the line of data could be interpreted as four words of data, one or more of which will be replaced by the result of a computation involving the four data words.
Typically, the word that contains the control scalar value (or shift amount, address, computation result, etc.) is identified by its position in a “preferred slot”. A preferred slot is simply a designated position in which this type of data is stored. The location of the preferred slot may depend upon its size—for instance, in a 128-bit line of data, it may be a designated byte, halfword, 32-bit word, doubleword or quadword.
One difficulty that may arise in relation to preferred slots is that, in a processor that accommodates both big-endian and little-endian data sources, the positions of the preferred slots may change. The changing of the preferred slots' positions is typically handled by incorporating multiplexers into the design of the processor, so that the preferred slot data can be read from or written to the different positions that the preferred slots may occupy. These multiplexers add complexity to the design, increase the space required for the processor, increase the delay in accessing the preferred slot data and potentially limit the maximum operating speed of the processor. It would therefore be desirable to provide systems and methods for accommodating the changing preferred slot positions resulting from changing data representations without having to use these multiplexers.